from volcenginesdkarkruntime import Ark
import easygui
api_key='38644548-12e0-44b6-bf40-4f5128d476f1'
Access_Key_ID='AKLTZTg4YmJiYWM2OTFjNDc3ZjliZTljMzkyYmI5YjVlNTY'
Secret_Access_Key='WkRnellqbGtaV05sWWpBNE5Ea3haRGxsT0RaalpUazVabUZtWWpobVpqVQ=='


def get_doubao_api(api_key, Access_Key_ID, Secret_Access_Key, prompt):
    try:
        client = Ark(api_key=api_key, ak=Access_Key_ID, sk=Secret_Access_Key)
 
        completion = client.chat.completions.create(
            model="ep-20240819081947-6v4vl",
            messages=[
                {"role": "system", "content": "你是豆包，是由字节跳动开发的 AI 人工智能助手"},
                {"role": "user", "content": prompt},
            ],
        )
        return completion.choices[0].message.content
    except Exception as e:
        return e

a=get_doubao_api(api_key,Access_Key_ID,Secret_Access_Key,'问我十个任意问题，并给出4个选项，存入python列表中,并将问题的答案存入另一个python列表中')
print(a)
questionsStr = strs.split('```')[1].split('questions = ')[1].split('answers = ')[0]
answersStr = strs.split('```')[1].split('questions = ')[1].split('answers = ')[1]
print(eval(questionsStr)[1])
print(eval(answersStr)[1])
for i in range(0,11):
    questions = eval(questionsStr)[i]
    answers = eval(answersStr)[i]
    ans = easygui.enterbox('请输入')
    if(ans in answers):
        pass
        
while True:
    easygui.msgbox(get_doubao_api(api_key,Access_Key_ID,Secret_Access_Key,a))
    a=easygui.enterbox('请输入')
